package com.itheima.utils;

import io.swagger.v3.oas.models.OpenAPI;
import io.swagger.v3.oas.models.info.Contact;
import io.swagger.v3.oas.models.info.License;
import org.springdoc.core.models.GroupedOpenApi;
import org.springframework.context.annotation.Bean;
import org.springframework.context.annotation.Configuration;

/**
 * knife4j配置类
 */
@Configuration
public class Knife4jProperties {

    @Bean
    public GroupedOpenApi publicApi() {
        return GroupedOpenApi.builder()
                .group("默认")
                .pathsToMatch("/**")
                .build();
    }


    /**
     * 配置基本信息
     */
    @Bean
    public OpenAPI openAPI() {
        return new OpenAPI()
                .info(new io.swagger.v3.oas.models.info.Info()
                        .title("tlias智能学习系统")
                        .description("tlias智能学习系统在线接口文档")
                        .version("v1.0")
                        .contact(new Contact()
                                .name("tlias")
                                .email("")
                                .url(""))
                        .license(new License().name("MIT"))
                );
    }


}
